package com.skivingcloud.report.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serial;
import java.util.List;
import java.util.Map;

/**
 *  实体类。
 *
 * @author skivingcloud
 * @since 2024-11-13
 */
@Schema(description = "")
@Table("report_tpl_dataset")
public class ReportTplDataset implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @Id
    @Schema(description = "主键id")
    private String id;

    /**
     * 租户
     */
    @Schema(description = "租户")
    private String tenantId;

    /**
     * 数据集类型 1sql 2api
     */
    @Schema(description = "数据集类型 1sql 2api")
    private String datasetType;

    /**
     * 数据集名称
     */
    @Schema(description = "数据集名称")
    private String datasetName;

    /**
     * 模板id
     */
    @Schema(description = "模板id")
    private String tplId;

    /**
     * 数据源id
     */
    @Schema(description = "数据源id")
    private String datasourceId;

    /**
     * sql语句
     */
    @Schema(description = "sql语句")
    private String tplSql;

    /**
     * 参数
     */
    @Schema(description = "参数")
    private String tplParam;

    /**
     * sql类型 1标准sql 2存储过程
     */
    @Schema(description = "sql类型 1标准sql 2存储过程")
    private String sqlType;

    /**
     * 存储过程入参
     */
    @Schema(description = "存储过程入参")
    private String inParam;

    /**
     * 存储过程出参
     */
    @Schema(description = "存储过程出参")
    private String outParam;

    /**
     * 是否分页 1是 0否
     */
    @Schema(description = "是否分页 1是 0否")
    private String isPagination;

    /**
     * 每页显示条数
     */
    @Schema(description = "每页显示条数")
    private Integer pageCount;

    /**
     * 类型 1报表 2大屏
     */
    @Schema(description = "类型 1报表 2大屏")
    private String type;

    /**
     * 创建人
     */
    @Schema(description = "创建人")
    private String creator;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @Schema(description = "更新人")
    private String updater;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    /**
     * 是否删除 1是 0否
     */
    @Schema(description = "是否删除 1是 0否")
    private String delFlag;

    /**
     * 当前页码属性
     */
    @Schema(description = "当前页码属性")
    private String currentPageAttr;

    /**
     * 每页显示条数属性
     */
    @Schema(description = "每页显示条数属性")
    private String pageCountAttr;

    /**
     * 数据总条数属性
     */
    @Schema(description = "数据总条数属性")
    private String totalAttr;

    /**
     * 数据列
     */
    @Column(ignore = true)
    private List<Map<String, Object>> columns;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getDatasetType() {
        return datasetType;
    }

    public void setDatasetType(String datasetType) {
        this.datasetType = datasetType;
    }

    public String getDatasetName() {
        return datasetName;
    }

    public void setDatasetName(String datasetName) {
        this.datasetName = datasetName;
    }

    public String getTplId() {
        return tplId;
    }

    public void setTplId(String tplId) {
        this.tplId = tplId;
    }

    public String getDatasourceId() {
        return datasourceId;
    }

    public void setDatasourceId(String datasourceId) {
        this.datasourceId = datasourceId;
    }

    public String getTplSql() {
        return tplSql;
    }

    public void setTplSql(String tplSql) {
        this.tplSql = tplSql;
    }

    public String getTplParam() {
        return tplParam;
    }

    public void setTplParam(String tplParam) {
        this.tplParam = tplParam;
    }

    public String getSqlType() {
        return sqlType;
    }

    public void setSqlType(String sqlType) {
        this.sqlType = sqlType;
    }

    public String getInParam() {
        return inParam;
    }

    public void setInParam(String inParam) {
        this.inParam = inParam;
    }

    public String getOutParam() {
        return outParam;
    }

    public void setOutParam(String outParam) {
        this.outParam = outParam;
    }

    public String getIsPagination() {
        return isPagination;
    }

    public void setIsPagination(String isPagination) {
        this.isPagination = isPagination;
    }

    public Integer getPageCount() {
        return pageCount;
    }

    public void setPageCount(Integer pageCount) {
        this.pageCount = pageCount;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String getUpdater() {
        return updater;
    }

    public void setUpdater(String updater) {
        this.updater = updater;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getCurrentPageAttr() {
        return currentPageAttr;
    }

    public void setCurrentPageAttr(String currentPageAttr) {
        this.currentPageAttr = currentPageAttr;
    }

    public String getPageCountAttr() {
        return pageCountAttr;
    }

    public void setPageCountAttr(String pageCountAttr) {
        this.pageCountAttr = pageCountAttr;
    }

    public String getTotalAttr() {
        return totalAttr;
    }

    public void setTotalAttr(String totalAttr) {
        this.totalAttr = totalAttr;
    }

    public List<Map<String, Object>> getColumns() {
        return columns;
    }

    public void setColumns(List<Map<String, Object>> columns) {
        this.columns = columns;
    }
}
